﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Codeplex.Reactive;
using System.Linq;
using System.Reactive.Linq;

namespace DataGridSample
{
    public class MainPageViewModel
    {
        public ReactiveCollection<PersonViewModel> People { get; private set; }

        public MainPageViewModel()
        {
            this.People =
                Enumerable.Range(1, 5)
                    .Select(i =>
                    {
                        var r = new PersonViewModel();
                        r.FirstName.Value = "Tanaka" + i;
                        r.LastName.Value = "Taro" + i;
                        r.Birthday.Value = DateTime.ParseExact("2000/04/01", "yyyy/MM/dd", null);
                        r.Age.Value = 30;
                        return r;
                    })
                    .ToObservable()
                    .ToReactiveCollection();

        }
    }
}
